#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3f;

void solve()
{
    int s, s1, s2, s3;
    cin >> s >> s1 >> s2 >> s3;
    if (s < 425 && (s1 < 60 || s2 < 60 || s3 < 60)) cout << "YES";
    else cout << "NO";
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    //cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}